<template>
  <component :is="iconName" v-if="iconName" :size="size" :color="color" />
</template>
  
<script setup>
import { computed, h } from "vue";

// 定义props
const props = defineProps({
  name: {
    type: String,
    required: true,
  },
  size: {
    type: [String, Number],
    default: 18,
  },
  color: {
    type: String,
    default: "#303133",
  },
});

// 计算图标组件名
const iconName = computed(() => {
  return iconMap[props.name] || null;
});

// 绘制图标
const DrawIcon = {
  name: "DrawIcon",
  props: ["size", "color"],
  render() {
    return h(
      "svg",
      {
        class: "icon",
        viewBox: "0 0 1024 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        width: this.size,
        height: this.size,
        fill: this.color,
      },
      [
        h("path", {
          d: "M221.8 723.5c-51.2 0-92.8-42.6-92.8-95.1 0.1-52.5 41.6-95 92.8-95.1H275c14.8 0 26.7 12.3 26.7 27.4 0 15.1-12 27.4-26.7 27.4h-53.2c-21.7 0-39.3 18.1-39.3 40.3 0 22.2 17.6 40.3 39.3 40.3h213.4c14.8 0 26.7 12.3 26.7 27.4 0 15.1-12 27.4-26.7 27.4H221.8z m579.9 135.3H300.5c-14.8 0-26.7-12.3-26.7-27.4 0-15.1 12-27.4 26.7-27.4h501.2c21.7 0 39.3-18.1 39.3-40.3 0-22.2-17.6-40.3-39.3-40.3H426.9c-14.8 0-26.7-12.3-26.7-27.4 0-15.1 12-27.4 26.7-27.4h374.8c51.2 0.1 92.8 42.6 92.8 95.1-0.1 52.6-41.6 95.1-92.8 95.1z m-281-668.3c0-14.6 11.6-26.5 25.9-26.5 14.3 0 25.8 11.9 25.8 26.5v159h155.2c14.3 0 25.9 11.9 25.9 26.5s-11.6 26.5-25.9 26.5H572.5v159c0 14.6-11.6 26.5-25.9 26.5-14.3 0-25.8-11.9-25.8-26.5v-159H365.5c-14.3 0-25.9-11.9-25.9-26.5s11.6-26.5 25.9-26.5h155.2v-159z",
        }),
      ]
    );
  },
};

// 添加图标
const AddIcon = {
  name: "AddIcon",
  props: ["size", "color"],
  render() {
    return h(
      "svg",
      {
        class: "icon",
        viewBox: "0 0 1024 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        width: this.size,
        height: this.size,
        fill: this.color,
      },
      [
        h("path", {
          d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm192 472c0 4.4-3.6 8-8 8H544v152c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V544H328c-4.4 0-8-3.6-8-8v-48c0-4.4 3.6-8 8-8h152V328c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v152h152c4.4 0 8 3.6 8 8v48z",
        }),
      ]
    );
  },
};

// 删除图标
const DeleteIcon = {
  name: "DeleteIcon",
  props: ["size", "color"],
  render() {
    return h(
      "svg",
      {
        class: "icon",
        viewBox: "0 0 1024 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        width: this.size,
        height: this.size,
        fill: this.color,
      },
      [
        h("path", {
          d: "M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z",
        }),
      ]
    );
  },
};

// 编辑图标
const EditIcon = {
  name: "EditIcon",
  props: ["size", "color"],
  render() {
    return h(
      "svg",
      {
        class: "icon",
        viewBox: "0 0 1024 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        width: this.size,
        height: this.size,
        fill: this.color,
      },
      [
        h("path", {
          d: "M880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32zm-622.3-84c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9c3.9-3.9 3.9-10.2 0-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2c-1.9 11.1 1.5 21.9 9.4 29.8 6.6 6.4 14.9 9.9 23.8 9.9z",
        }),
      ]
    );
  },
};

// 保存图标
const SaveIcon = {
  name: "SaveIcon",
  props: ["size", "color"],
  render() {
    return h(
      "svg",
      {
        class: "icon",
        viewBox: "0 0 1024 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        width: this.size,
        height: this.size,
        fill: this.color,
      },
      [
        h("path", {
          d: "M893.3 293.3L730.7 130.7c-12-12-28.3-18.7-45.3-18.7H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 176h256v112H384V176zm128 554H384V586h128v144zm128-128H384V458h256v144zm128-128H384V330h256v272z",
        }),
      ]
    );
  },
};

// 关闭图标
const CloseIcon = {
  name: "CloseIcon",
  props: ["size", "color"],
  render() {
    return h(
      "svg",
      {
        class: "icon",
        viewBox: "0 0 1024 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        width: this.size,
        height: this.size,
        fill: this.color,
      },
      [
        h("path", {
          d: "M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-1.5 0-2.9.6-3.9 1.6L511.6 449.8 295.1 191.7c-1-1-2.4-1.6-3.9-1.6h-79.8c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c1.5 0 2.9-.6 3.9-1.6l216.5-258.1 216.5 258.1c1 1 2.4 1.6 3.9 1.6h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z",
        }),
      ]
    );
  },
};

// 搜索图标
const SearchIcon = {
  name: "SearchIcon",
  props: ["size", "color"],
  render() {
    return h(
      "svg",
      {
        class: "icon",
        viewBox: "0 0 1024 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        width: this.size,
        height: this.size,
        fill: this.color,
      },
      [
        h("path", {
          d: "M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z",
        }),
      ]
    );
  },
};

// 位置图标
const LocationIcon = {
  name: "LocationIcon",
  props: ["size", "color"],
  render() {
    return h(
      "svg",
      {
        class: "icon",
        viewBox: "0 0 1024 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        width: this.size,
        height: this.size,
        fill: this.color,
      },
      [
        h("path", {
          d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z",
        }),
        h("path", {
          d: "M464 688a48 48 0 1 0 96 0 48 48 0 1 0-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z",
        }),
      ]
    );
  },
};

// 飞行图标
const FlightIcon = {
  name: "FlightIcon",
  props: ["size", "color"],
  render() {
    return h(
      "svg",
      {
        class: "icon",
        viewBox: "0 0 1024 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        width: this.size,
        height: this.size,
        fill: this.color,
      },
      [
        h("path", {
          d: "M912 190.3H799.2c-3.6 0-7 1.4-9.5 3.9L484.7 498.8 164.3 185.4c-2.5-2.5-5.9-3.9-9.5-3.9H112c-4.4 0-8 3.6-8 8v60.9c0 4.4 3.6 8 8 8h125.3L443 513.4 237.3 718.2H112c-4.4 0-8 3.6-8 8v60.9c0 4.4 3.6 8 8 8h42.8c3.6 0 7-1.4 9.5-3.9L484.7 525.2l314.7 313.4c2.5 2.5 5.9 3.9 9.5 3.9H912c4.4 0 8-3.6 8-8v-60.9c0-4.4-3.6-8-8-8H798.7L581 513.4 798.7 296.2H912c4.4 0 8-3.6 8-8v-60.9c0-4.4-3.6-8-8-8z",
        }),
      ]
    );
  },
};

// 路线图标
const RouteIcon = {
  name: "RouteIcon",
  props: ["size", "color"],
  render() {
    return h(
      "svg",
      {
        class: "icon",
        viewBox: "0 0 1024 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        width: this.size,
        height: this.size,
        fill: this.color,
      },
      [
        h("path", {
          d: "M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zM368 744c0 4.4-3.6 8-8 8h-56c-4.4 0-8-3.6-8-8V280c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v464zm152-240c0 4.4-3.6 8-8 8h-56c-4.4 0-8-3.6-8-8V280c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v224zm152 72c0 4.4-3.6 8-8 8h-56c-4.4 0-8-3.6-8-8V280c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v296z",
        }),
      ]
    );
  },
};
// 标点图标
const Punctuation = {
  name: "Punctuation",
  props: ["size", "color"],
  render() {
    return h(
      "svg",
      {
        t: "1750908756195",
        viewBox: "0 0 1024 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        pId: "5025",
        width: this.size,
        height: this.size,
        fill: this.color,
      },
      [
        h("path", {
          d: "M512 1006.34L203.038 512 512 17.66 820.962 512 512 1006.34zM320.962 512L512 817.66 703.037 512 512 206.34 320.962 512z",
          pId: "5026",
        }),
      ]
    );
  },
};
// 标线图标
const LineIcon = {
  name: "LineIcon",
  props: ["size", "color"],
  render() {
    return h(
      "svg",
      {
        t: "1750914519385",
        class: "icon",
        viewBox: "0 0 1072 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        pId: "6981",
        width: this.size,
        height: this.size,
        fill: this.color,
      },
      [
        h("path", {
          d: "M663.942095 336.11581a97.52381 97.52381 0 1 1 54.125715 54.125714L406.040381 702.171429a97.52381 97.52381 0 1 1-54.125714-54.125715l311.978666-311.929904z",
          pId: "6982",
        }),
      ]
    );
  },
};
// 范围图标
const RangeIcon = {
  name: "RangeIcon",
  props: ["size", "color"],
  render() {
    return h(
      "svg",
      {
        t: "1750914599960",
        class: "icon",
        viewBox: "0 0 1024 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        pId: "10811",
        width: this.size,
        height: this.size,
        fill: this.color,
      },
      [
        h("path", {
          d: "M896 801.632V222.368c36.48-7.424 64-39.744 64-78.368C960 99.904 924.128 64 880 64c-38.656 0-70.944 27.52-78.368 64H222.368A80.096 80.096 0 0 0 144 64 80.096 80.096 0 0 0 64 144c0 38.624 27.52 70.944 64 78.368V801.6c-36.48 7.424-64 39.744-64 78.368A80.096 80.096 0 0 0 144 960c38.624 0 70.944-27.52 78.368-64H801.6c7.424 36.48 39.744 64 78.368 64A80 80 0 1 0 896 801.632z m-704 14.784V207.584c5.888-4.448 11.136-9.696 15.584-15.584h608.8c4.48 5.888 9.696 11.136 15.584 15.584v608.8c-5.92 4.48-11.136 9.696-15.616 15.616H207.584A79.04 79.04 0 0 0 192 816.416z",
          pId: "10812",
        }),
      ]
    );
  },
};
//标圆图标
const CircleIcon = {
  name: "CircleIcon",
  props: ["size", "color"],
  render() {
    return h(
      "svg",
      {
        class: "icon",
        viewBox: "0 0 1024 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        width: this.size,
        height: this.size,
        fill: this.color,
      },
      [
        h("path", {
          d: "M453.71093 0q100.827462 0 190.554653 44.401084 86.0271 42.551039 147.07859 118.402891t83.252033 170.204155q29.600723 9.250226 48.563686 34.688347T942.122855 424.585366q0 31.450768-18.037941 56.426377T877.371274 515.237579q-18.500452 98.977416-79.551942 178.529359T648.890696 817.719964q-91.577236 46.251129-195.179766 46.251129-116.552846 0-217.380307-59.201445-98.052394-57.3514-154.478771-154.478772-59.201445-100.827462-59.201445-218.305329t59.201445-218.30533Q138.278229 116.552846 236.330623 59.201445q100.827462-59.201445 217.380307-59.201445z m0 66.601626q-105.452575 0-189.629629 47.176152-82.32701 46.251129-128.578139 128.578139-47.176152 84.177055-47.176152 189.62963t47.176152 189.629629q46.251129 82.32701 128.578139 128.578139 84.177055 47.176152 189.629629 47.176152 91.577236 0 168.354111-35.150858 74.001807-35.150858 123.490515-99.439928T811.69467 514.312556q-26.825655-11.100271-43.938572-35.150858T750.64318 425.510388q0-29.600723 16.187895-53.651309t42.088528-35.150859q-18.500452-80.476965-68.451672-141.990966T618.36495 99.902439q-74.926829-33.300813-164.65402-33.300813z m67.526649 296.007227v137.828365H384.334237V362.608853h136.903342z",
        }),
      ]
    );
  },
};
//指南针
const CompassIcon = {
  name: "CompassIcon",
  props: ["size", "color"],
  render() {
    return h(
      "svg",
      {
        width: "60px",
        height: "60px",
        viewBox: "0 0 60 60",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        xmlnsXlink: "http://www.w3.org/1999/xlink",
      },
      [
        h("title", "编组 43"),
        h("defs", [h("circle", { id: "path-1", cx: "30", cy: "30", r: "30" })]),
        h(
          "g",
          {
            id: "M1-添加",
            stroke: "none",
            strokeWidth: "1",
            fill: "none",
            fillRule: "evenodd",
          },
          [
            h(
              "g",
              {
                id: "全景图&超解析照片",
                transform: "translate(-863.000000, -2455.000000)",
              },
              [
                h(
                  "g",
                  {
                    id: "编组-43",
                    transform: "translate(863.000000, 2455.000000)",
                  },
                  [
                    h("mask", { id: "mask-2", fill: "white" }, [
                      h("use", { xlinkHref: "#path-1" }),
                    ]),
                    h("use", {
                      id: "椭圆形",
                      fill: "#FFFFFF",
                      xlinkHref: "#path-1",
                    }),
                    h("polygon", {
                      id: "N",
                      fill: "#4E4E4E",
                      fillRule: "nonzero",
                      mask: "url(#mask-2)",
                      points:
                        "29.0742188 6.7265625 29.0742188 2.9921875 31.3828125 6.7265625 32.5429688 6.7265625 32.5429688 1 31.46875 1 31.46875 4.82421875 29.125 1 28 1 28 6.7265625",
                    }),
                    h("path", {
                      d: "M30.3632812,57.9257812 C30.8606771,57.9257812 31.2760417,57.8561198 31.609375,57.7167969 C31.9427083,57.577474 32.2005208,57.3645833 32.3828125,57.078125 C32.5651042,56.7916667 32.65625,56.484375 32.65625,56.15625 C32.65625,55.7942708 32.5800781,55.4902344 32.4277344,55.2441406 C32.2753906,54.9980469 32.0644531,54.8040365 31.7949219,54.6621094 C31.5253906,54.5201823 31.109375,54.3828125 30.546875,54.25 C29.984375,54.1171875 29.6302083,53.9895833 29.484375,53.8671875 C29.3697917,53.7708333 29.3125,53.6549479 29.3125,53.5195312 C29.3125,53.3710938 29.3736979,53.2526042 29.4960938,53.1640625 C29.6861979,53.0260417 29.9492188,52.9570312 30.2851562,52.9570312 C30.6106771,52.9570312 30.8548177,53.0214844 31.0175781,53.1503906 C31.1803385,53.2792969 31.2864583,53.4908854 31.3359375,53.7851562 L31.3359375,53.7851562 L32.4921875,53.734375 C32.4739583,53.2083333 32.2832031,52.7877604 31.9199219,52.4726562 C31.5566406,52.1575521 31.015625,52 30.296875,52 C29.8567708,52 29.4811198,52.0664062 29.1699219,52.1992188 C28.858724,52.3320312 28.6204427,52.5253906 28.4550781,52.7792969 C28.2897135,53.0332031 28.2070312,53.3059896 28.2070312,53.5976562 C28.2070312,54.0507812 28.3828125,54.4348958 28.734375,54.75 C28.984375,54.9739583 29.4192708,55.1627604 30.0390625,55.3164062 C30.5208333,55.4361979 30.8294271,55.5195312 30.9648438,55.5664062 C31.1627604,55.6367188 31.3014323,55.719401 31.3808594,55.8144531 C31.4602865,55.9095052 31.5,56.0247396 31.5,56.1601562 C31.5,56.3710938 31.405599,56.5553385 31.2167969,56.7128906 C31.0279948,56.8704427 30.7473958,56.9492188 30.375,56.9492188 C30.0234375,56.9492188 29.7441406,56.8606771 29.5371094,56.6835938 C29.3300781,56.5065104 29.1927083,56.2291667 29.125,55.8515625 L29.125,55.8515625 L28,55.9609375 C28.0755208,56.6015625 28.3072917,57.0891927 28.6953125,57.4238281 C29.0833333,57.7584635 29.6393229,57.9257812 30.3632812,57.9257812 Z",
                      id: "S",
                      fill: "#4E4E4E",
                      fillRule: "nonzero",
                      mask: "url(#mask-2)",
                      transform:
                        "translate(30.328125, 54.962891) rotate(180.000000) translate(-30.328125, -54.962891)",
                    }),
                    h("polygon", {
                      id: "W",
                      fill: "#4E4E4E",
                      fillRule: "nonzero",
                      mask: "url(#mask-2)",
                      transform:
                        "translate(5.757812, 29.863281) rotate(-90.000000) translate(-5.757812, -29.863281)",
                      points:
                        "4.62109375 32.7265625 5.7578125 28.4453125 6.8984375 32.7265625 8.125 32.7265625 9.515625 27 8.3515625 27 7.47265625 31 6.46875 27 5.09375 27 4.046875 30.9335938 3.18359375 27 2 27 3.3671875 32.7265625",
                    }),
                    h("polygon", {
                      id: "E",
                      fill: "#4E4E4E",
                      fillRule: "nonzero",
                      mask: "url(#mask-2)",
                      transform:
                        "translate(55.177734, 29.863281) rotate(90.000000) translate(-55.177734, -29.863281)",
                      points:
                        "57.3554688 32.7265625 57.3554688 31.7617188 54.15625 31.7617188 54.15625 30.203125 57.03125 30.203125 57.03125 29.2382812 54.15625 29.2382812 54.15625 27.96875 57.2460938 27.96875 57.2460938 27 53 27 53 32.7265625",
                    }),
                  ]
                ),
              ]
            ),
          ]
        ),
      ]
    );
  },
};
// 方向图标
const DirectionIcon = {
  name: "DirectionIcon",
  props: ["size", "color"],
  render() {
    return h(
      "svg",
      {
        style: {
          position: "absolute",
          top: "50%",
          left: "50%",
          transform: "translate(-50%, -50%)",
        },
        width: "40px",
        height: "43px",
        viewBox: "0 0 40 43",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        xmlnsXlink: "http://www.w3.org/1999/xlink",
      },
      [
        h("title", "编组 44"),
        h(
          "g",
          {
            id: "M1-添加",
            stroke: "none",
            strokeWidth: "1",
            fill: "none",
            fillRule: "evenodd",
          },
          [
            h(
              "g",
              {
                id: "全景图&超解析照片",
                transform: "translate(-873.000000, -2462.000000)",
              },
              [
                h(
                  "g",
                  {
                    id: "2图标/map/compass备份-12",
                    transform: "translate(863.000000, 2455.000000)",
                  },
                  [
                    h(
                      "g",
                      {
                        id: "编组-44",
                        transform: "translate(10.000000, 7.000000)",
                      },
                      [
                        h("circle", {
                          id: "椭圆形备份-2",
                          stroke: "#A2A2A2",
                          strokeWidth: "1.5",
                          fill: "#FFFFFF",
                          cx: "20",
                          cy: "23",
                          r: "19.25",
                        }),
                        h("polygon", {
                          id: "三角形",
                          fill: "#E02020",
                          points: "20 0 33 8 7 8",
                        }),
                      ]
                    ),
                  ]
                ),
              ]
            ),
          ]
        ),
      ]
    );
  },
};
// 警告图标
const WarningIcon = {
  name: "WarningIcon",
  props: ["size", "color"],
  render() {
    return h(
      "svg",
      {
        t: "1751611448773",
        class: "icon",
        viewBox: "0 0 1024 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        pId: "19644",
        width: this.size,
        height: this.size,
        fill: this.color,
      },
      [
        h("path", {
          d: "M512 56.888889C261.688889 56.888889 56.888889 261.688889 56.888889 512s204.8 455.111111 455.111111 455.111111 455.111111-204.8 455.111111-455.111111-204.8-455.111111-455.111111-455.111111m0 853.333333c-221.866667 0-398.222222-176.355556-398.222222-398.222222s176.355556-398.222222 398.222222-398.222222 398.222222 176.355556 398.222222 398.222222-176.355556 398.222222-398.222222 398.222222",
          pId: "19645",
        }),
        h("path", {
          d: "M512 682.666667c-17.066667 0-28.444444 5.688889-39.822222 17.066666-11.377778 11.377778-17.066667 22.755556-17.066667 39.822223 0 17.066667 5.688889 28.444444 17.066667 39.822222 11.377778 11.377778 22.755556 17.066667 39.822222 17.066666 17.066667 0 28.444444-5.688889 39.822222-17.066666 11.377778-11.377778 17.066667-22.755556 17.066667-39.822222 0-17.066667-5.688889-28.444444-17.066667-39.822223-11.377778-11.377778-22.755556-17.066667-39.822222-17.066666z m-51.2-455.111111l17.066667 409.6h62.577777L563.2 227.555556H460.8z",
          pId: "19646",
        }),
      ]
    );
  },
};
// 自定义图标
const CustomIcon = {
  name: "CustomIcon",
  props: ["size", "color"],
  render() {
    return h(
      "svg",
      {
        t: "1751614686388",
        viewBox: "0 0 1024 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        pId: "20863",
        width: this.size,
        height: this.size,
        fill: this.color,
      },
      [
        h("path", {
          d: "M568.192 51.2l47.2064 56.2688 68.992-25.1392 31.0272 66.56 73.1648-6.4 12.7232 72.32 72.32 12.7232-6.4 73.1648 66.56 31.0272-25.1392 68.992 56.2688 47.2064-42.1376 60.1344 42.1376 60.16-56.2688 47.1808 25.1392 68.992-66.56 31.0272 6.4 73.1648-72.32 12.7232-12.7232 72.32-73.1648-6.4-31.0272 66.56-68.992-25.1392-47.2064 56.2688-60.1344-42.1376-60.16 42.1376-47.1808-56.2688-68.992 25.1392-31.0272-66.56-73.1648 6.4-12.7232-72.32-72.32-12.7232 6.4-73.1648-66.56-31.0272 25.1392-68.992L51.2 568.192l42.1376-60.1344L51.2 447.8976l56.2688-47.1808-25.1392-68.992 66.56-31.0272-6.4-73.1648 72.32-12.7232 12.7232-72.32 73.1648 6.4 31.0272-66.56 68.992 25.1392L447.9232 51.2l60.1344 42.1376L568.2176 51.2z m34.2528 104.576l-41.5232-49.4848L508.0576 143.36 455.168 106.2912l-41.4976 49.4848-60.6976-22.1184-27.264 58.5472-64.3584-5.6576-11.1872 63.616-63.616 11.1872 5.6576 64.3584-58.5472 27.264 22.1184 60.672-49.4848 41.5232L143.36 508.0576l-37.0688 52.864 49.4848 41.5232-22.1184 60.672 58.5472 27.2896-5.6576 64.3328 63.616 11.2128 11.1872 63.5904 64.3584-5.632 27.264 58.5216 60.672-22.0928 41.5232 49.4592 52.8896-37.0432 52.864 37.0432 41.5232-49.4592 60.672 22.0928 27.2896-58.5216 64.3328 5.632 11.2128-63.5904 63.5904-11.2128-5.632-64.3328 58.5216-27.2896-22.0928-60.672 49.4592-41.5232-37.0432-52.864 37.0432-52.8896-49.4592-41.4976 22.0928-60.6976-58.5216-27.264 5.632-64.3584-63.5904-11.1872-11.2128-63.616-64.3328 5.6576-27.2896-58.5472-60.672 22.1184z",
          pId: "20864",
        }),
      ]
    );
  },
};
// 作业区
const JobAreaIcon = {
  name: "JobAreaIcon",
  props: ["size", "color"],
  render() {
    return h(
      "svg",
      {
        t: "1751614686388",
        viewBox: "0 0 1024 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        pId: "20863",
        width: this.size,
        height: this.size,
        fill: this.color,
      },
      [
        h("path", {
          d: "M568.192 51.2l47.2064 56.2688 68.992-25.1392 31.0272 66.56 73.1648-6.4 12.7232 72.32 72.32 12.7232-6.4 73.1648 66.56 31.0272-25.1392 68.992 56.2688 47.2064-42.1376 60.1344 42.1376 60.16-56.2688 47.1808 25.1392 68.992-66.56 31.0272 6.4 73.1648-72.32 12.7232-12.7232 72.32-73.1648-6.4-31.0272 66.56-68.992-25.1392-47.2064 56.2688-60.1344-42.1376-60.16 42.1376-47.1808-56.2688-68.992 25.1392-31.0272-66.56-73.1648 6.4-12.7232-72.32-72.32-12.7232 6.4-73.1648-66.56-31.0272 25.1392-68.992L51.2 568.192l42.1376-60.1344L51.2 447.8976l56.2688-47.1808-25.1392-68.992 66.56-31.0272-6.4-73.1648 72.32-12.7232 12.7232-72.32 73.1648 6.4 31.0272-66.56 68.992 25.1392L447.9232 51.2l60.1344 42.1376L568.2176 51.2z m34.2528 104.576l-41.5232-49.4848L508.0576 143.36 455.168 106.2912l-41.4976 49.4848-60.6976-22.1184-27.264 58.5472-64.3584-5.6576-11.1872 63.616-63.616 11.1872 5.6576 64.3584-58.5472 27.264 22.1184 60.672-49.4848 41.5232L143.36 508.0576l-37.0688 52.864 49.4848 41.5232-22.1184 60.672 58.5472 27.2896-5.6576 64.3328 63.616 11.2128 11.1872 63.5904 64.3584-5.632 27.264 58.5216 60.672-22.0928 41.5232 49.4592 52.8896-37.0432 52.864 37.0432 41.5232-49.4592 60.672 22.0928 27.2896-58.5216 64.3328 5.632 11.2128-63.5904 63.5904-11.2128-5.632-64.3328 58.5216-27.2896-22.0928-60.672 49.4592-41.5232-37.0432-52.864 37.0432-52.8896-49.4592-41.4976 22.0928-60.6976-58.5216-27.264 5.632-64.3584-63.5904-11.1872-11.2128-63.616-64.3328 5.6576-27.2896-58.5472-60.672 22.1184z",
          pId: "20864",
        }),
      ]
    );
  },
};
// 禁止区
const ForbiddenAreaIcon = {
  name: "ForbiddenAreaIcon",
  props: ["size", "color"],
  render() {
    return h(
      "svg",
      {
        t: "1751614686388",
        viewBox: "0 0 1024 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        pId: "20863",
        width: this.size,
        height: this.size,
        fill: this.color,
      },
      [
        h("path", {
          d: "M568.192 51.2l47.2064 56.2688 68.992-25.1392 31.0272 66.56 73.1648-6.4 12.7232 72.32 72.32 12.7232-6.4 73.1648 66.56 31.0272-25.1392 68.992 56.2688 47.2064-42.1376 60.1344 42.1376 60.16-56.2688 47.1808 25.1392 68.992-66.56 31.0272 6.4 73.1648-72.32 12.7232-12.7232 72.32-73.1648-6.4-31.0272 66.56-68.992-25.1392-47.2064 56.2688-60.1344-42.1376-60.16 42.1376-47.1808-56.2688-68.992 25.1392-31.0272-66.56-73.1648 6.4-12.7232-72.32-72.32-12.7232 6.4-73.1648-66.56-31.0272 25.1392-68.992L51.2 568.192l42.1376-60.1344L51.2 447.8976l56.2688-47.1808-25.1392-68.992 66.56-31.0272-6.4-73.1648 72.32-12.7232 12.7232-72.32 73.1648 6.4 31.0272-66.56 68.992 25.1392L447.9232 51.2l60.1344 42.1376L568.2176 51.2z m34.2528 104.576l-41.5232-49.4848L508.0576 143.36 455.168 106.2912l-41.4976 49.4848-60.6976-22.1184-27.264 58.5472-64.3584-5.6576-11.1872 63.616-63.616 11.1872 5.6576 64.3584-58.5472 27.264 22.1184 60.672-49.4848 41.5232L143.36 508.0576l-37.0688 52.864 49.4848 41.5232-22.1184 60.672 58.5472 27.2896-5.6576 64.3328 63.616 11.2128 11.1872 63.5904 64.3584-5.632 27.264 58.5216 60.672-22.0928 41.5232 49.4592 52.8896-37.0432 52.864 37.0432 41.5232-49.4592 60.672 22.0928 27.2896-58.5216 64.3328 5.632 11.2128-63.5904 63.5904-11.2128-5.632-64.3328 58.5216-27.2896-22.0928-60.672 49.4592-41.5232-37.0432-52.864 37.0432-52.8896-49.4592-41.4976 22.0928-60.6976-58.5216-27.264 5.632-64.3584-63.5904-11.1872-11.2128-63.616-64.3328 5.6576-27.2896-58.5472-60.672 22.1184z",
          pId: "20864",
        }),
      ]
    );
  },
};
//危险区
const DangerousAreaIcon = {
  name: "DangerousAreaIcon",
  props: ["size", "color"],
  render() {
    return h(
      "svg",
      {
        t: "1751609079725",
        viewBox: "0 0 1024 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        pId: "4660",
        width: this.size,
        height: this.size,
        fill: this.color,
      },
      [
        h("path", {
          d: "M596.562 830.99l11.947-192.1 367.547 183.187V710.714L615.134 370.097V155.791c-0.02-56.63-45.548-142.138-101.694-142.138S411.767 99.161 411.767 155.791v214.255L50.842 710.766v111.363l361.472-183.187 14.755 207.926a131.335 131.335 0 0 0 1.12 14.61l-65.71 59.938v66.13L514.259 937l2.434-0.83L662 987.547v-66.13l-67.782-61.843 2.287-28.583z",
          pId: "4661",
        }),
      ]
    );
  },
};
//高碰撞风险载人飞机
const HighCollisionRiskIcon = {
  name: "HighCollisionRiskIcon",
  props: ["size", "color"],
  render() {
    return h(
      "svg",
      {
        t: "1751609079725",
        viewBox: "0 0 1024 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        pId: "4660",
        width: this.size,
        height: this.size,
        fill: this.color,
      },
      [
        h("path", {
          d: "M596.562 830.99l11.947-192.1 367.547 183.187V710.714L615.134 370.097V155.791c-0.02-56.63-45.548-142.138-101.694-142.138S411.767 99.161 411.767 155.791v214.255L50.842 710.766v111.363l361.472-183.187 14.755 207.926a131.335 131.335 0 0 0 1.12 14.61l-65.71 59.938v66.13L514.259 937l2.434-0.83L662 987.547v-66.13l-67.782-61.843 2.287-28.583z",
          pId: "4661",
        }),
      ]
    );
  },
};
//中碰撞风险载人飞机
const MediumCollisionRiskIcon = {
  name: "MediumCollisionRiskIcon",
  props: ["size", "color"],
  render() {
    return h(
      "svg",
      {
        t: "1751609079725",
        viewBox: "0 0 1024 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        pId: "4660",
        width: this.size,
        height: this.size,
        fill: this.color,
      },
      [
        h("path", {
          d: "M596.562 830.99l11.947-192.1 367.547 183.187V710.714L615.134 370.097V155.791c-0.02-56.63-45.548-142.138-101.694-142.138S411.767 99.161 411.767 155.791v214.255L50.842 710.766v111.363l361.472-183.187 14.755 207.926a131.335 131.335 0 0 0 1.12 14.61l-65.71 59.938v66.13L514.259 937l2.434-0.83L662 987.547v-66.13l-67.782-61.843 2.287-28.583z",
          pId: "4661",
        }),
      ]
    );
  },
};
//低碰撞风险载人飞机
const LowCollisionRiskIcon = {
  name: "LowCollisionRiskIcon",
  props: ["size", "color"],
  render() {
    return h(
      "svg",
      {
        t: "1751609079725",
        viewBox: "0 0 1024 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        pId: "4660",
        width: this.size,
        height: this.size,
        fill: this.color,
      },
      [
        h("path", {
          d: "M596.562 830.99l11.947-192.1 367.547 183.187V710.714L615.134 370.097V155.791c-0.02-56.63-45.548-142.138-101.694-142.138S411.767 99.161 411.767 155.791v214.255L50.842 710.766v111.363l361.472-183.187 14.755 207.926a131.335 131.335 0 0 0 1.12 14.61l-65.71 59.938v66.13L514.259 937l2.434-0.83L662 987.547v-66.13l-67.782-61.843 2.287-28.583z",
          pId: "4661",
        }),
      ]
    );
  },
};
//中心点
const CenterIcon = {
  name: "CenterIcon",
  props: ["size", "color"],
  render() {
    return h(
      "svg",
      {
        t: "1751609136800",
        viewBox: "0 0 1024 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        pId: "5644",
        width: this.size,
        height: this.size,
        fill: this.color,
      },
      [
        h("path", {
          d: "M433.792 512a78.208 78.208 0 1 0 156.416 0 78.208 78.208 0 0 0-156.416 0z",
          pId: "5645",
        }),
        h("path", {
          d: "M950.058667 480.725333h-32.896a406.826667 406.826667 0 0 0-373.888-373.888v-32.853333a31.274667 31.274667 0 1 0-62.549334 0v32.853333a406.826667 406.826667 0 0 0-373.888 373.888h-32.853333a31.274667 31.274667 0 1 0 0 62.549334h32.853333a406.826667 406.826667 0 0 0 373.888 373.888v32.853333a31.274667 31.274667 0 1 0 62.549334 0v-32.853333a406.826667 406.826667 0 0 0 373.888-373.888h32.853333a31.274667 31.274667 0 1 0 0-62.549334z m-406.784 373.845334V793.6a31.274667 31.274667 0 1 0-62.549334 0v61.013333a344.490667 344.490667 0 0 1-311.296-311.338666H230.4a31.274667 31.274667 0 1 0 0-62.549334H169.386667a344.490667 344.490667 0 0 1 311.338666-311.296V230.4a31.274667 31.274667 0 1 0 62.549334 0V169.386667a344.490667 344.490667 0 0 1 311.296 311.338666H793.6a31.274667 31.274667 0 1 0 0 62.549334h61.013333a344.490667 344.490667 0 0 1-311.338666 311.296z",
          pId: "5646",
        }),
      ]
    );
  },
};

// 航点
const WaypointIcon = {
  name: "WaypointIcon",
  props: ["size", "color"],
  render() {
    return h(
      "svg",
      {
        t: "1751003876691",
        class: "icon",
        viewBox: "0 0 1027 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        pId: "36843",
        width: this.size,
        height: this.size,
        fill: this.color,
        style: "transform: rotate(180deg)",
      },
      [
        h("path", {
          d: "M42.666667 256c25.6 0 42.666667 17.066667 42.666666 42.666667 0 213.333333 157.866667 384 354.133334 384 51.2 0 98.133333-12.8 145.066666-34.133334 102.4-51.2 174.933333-149.333333 200.533334-268.8l-110.933334 72.533334c-21.333333 12.8-46.933333 8.533333-59.733333-12.8-12.8-21.333333-8.533333-46.933333 12.8-59.733334l187.733333-119.466666h4.266667c4.266667 0 4.266667 0 8.533333-4.266667H853.333333c4.266667 0 4.266667 0 8.533334 4.266667 4.266667 0 4.266667 4.266667 8.533333 4.266666l4.266667 4.266667 4.266666 4.266667 140.8 187.733333c12.8 17.066667 8.533333 46.933333-8.533333 59.733333-8.533333 4.266667-17.066667 8.533333-25.6 8.533334-12.8 0-25.6-4.266667-34.133333-17.066667l-76.8-102.4c-29.866667 136.533333-119.466667 256-243.2 315.733333-55.466667 29.866667-119.466667 42.666667-183.466667 42.666667C196.266667 768 0 558.933333 0 298.666667c0-25.6 17.066667-42.666667 42.666667-42.666667z",
          pId: "36844",
        }),
      ]
    );
  },
};
// 图标映射表
const iconMap = {
  draw: DrawIcon,
  add: AddIcon,
  delete: DeleteIcon,
  edit: EditIcon,
  save: SaveIcon,
  close: CloseIcon,
  search: SearchIcon,
  location: LocationIcon,
  flight: FlightIcon,
  route: RouteIcon,
  punctuation: Punctuation,
  line: LineIcon,
  range: RangeIcon,
  circle: CircleIcon,
  compass: CompassIcon,
  direction: DirectionIcon,
  warning: WarningIcon,
  custom: CustomIcon,
  jobArea: JobAreaIcon,
  forbiddenArea: ForbiddenAreaIcon,
  dangerousArea: DangerousAreaIcon,
  highCollisionRisk: HighCollisionRiskIcon,
  mediumCollisionRisk: MediumCollisionRiskIcon,
  lowCollisionRisk: LowCollisionRiskIcon,
  center: CenterIcon,
};
</script>
  
  <style scoped>
.icon {
  display: inline-block;
  vertical-align: middle;
}
</style> 